/**
 * 
 */
package paperockscissors;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author YacineFekih
 *
 */
public class Player {
	
    int currentMove;
    private List<RPSEnum> moves;
	private String name;
    private int score;

    /**
     * Constructor
     * @param playerName
     * @param playerMoves
     */
    
    public Player(String playerName, List<RPSEnum> playerMoves)
    {
            this.name = playerName;
            this.moves = playerMoves;
    }

    /**
     * Constructor
     * @param playerName
     */
    public Player(String playerName)
    {
            
            this.name = playerName;
            this.moves = new ArrayList<RPSEnum>();
            Random randRPS = new Random();
            
            for(int i=0;i<10;i++) {
                    int r = randRPS.nextInt(3);
                    
                    switch(r)
                    {
                    case 0:
                        this.moves.add(RPSEnum.ROCK);
                        break;
                    case 1:
                        this.moves.add(RPSEnum.PAPER);
                        break;
                    case 2:
                        this.moves.add(RPSEnum.SCISSORS);
                        break;
                    default:
                    	break;
                    }
            }
    }
    
	public int getScore() {
		int score = this.score;
        return score;
	}
	
	public RPSEnum getNextMove() {
		
		RPSEnum rps = this.moves.get(currentMove++);
        return rps;
	}
	
    public String getName() {
        return this.name;
    }
	
	public int numberOfMoves() {
			int size = this.moves.size();
	        return size;
	}

	
	public void setScore(int playerScore) {
	        this.score = playerScore;
	}
	
}
